﻿using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace AchievementSample.Extensions
{
    public static class LinqExtensions
    {
        public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> collection)
        {
            if (collection == null) return null;

            var obv = new ObservableCollection<T>();
            foreach (T item in collection)
            {
                obv.Add(item);
            }
            return obv;
        }
    }
}